package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;
import java.util.List;

public class TopicBean {
    private int id;
    private String name;
    private String info;
    private UserBean user;
    private ChannelBean channel;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deliverDate = LocalDateTime.now();

    private int count;  //回贴数量

    private List<ResBean> ResList;

    public TopicBean(String name, String info,int userId, int channelId) {
        this.name = name;
        this.info = info;
        this.user = new UserBean();
        this.user.setId(userId);
        this.channel = new ChannelBean();
        this.channel.setId(channelId);
    }

    public TopicBean() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public ChannelBean getChannel() {
        return channel;
    }

    public void setChannel(ChannelBean channel) {
        this.channel = channel;
    }

    public LocalDateTime getDeliverDate() {
        return deliverDate;
    }

    public void setDeliverDate(LocalDateTime deliverDate) {
        this.deliverDate = deliverDate;
    }

    public List<ResBean> getResList() {
        return ResList;
    }

    public void setResList(List<ResBean> resList) {
        ResList = resList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "TopicBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", info='" + info + '\'' +
                ", user=" + user +
                ", channel=" + channel +
                ", deliverDate=" + deliverDate +
                ", count=" + count +
                ", ResList=" + ResList +
                "}\n";
    }
}
